package com.itheima.Demo2;


import java.util.ArrayList;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Object> objects = new ArrayList<>();
        objects.add("xc");
        System.out.println("请输入:");
        String s=scanner.next();
        if (objects.contains(s)){
            System.out.println("已存在");
        }else {
            objects.add(s);
            System.out.println("已添加");
        }
    }
}
